//
//  MoreSingerTableViewController.m
//  WXMusic
//
//  Created by 漫步人生路 on 15/9/5.
//  Copyright (c) 2015年 漫步人生路. All rights reserved.
//

#import "MoreSingerTableViewController.h"
#import "MoreSingerTableViewCell.h"
@interface MoreSingerTableViewController ()

@end

@implementation MoreSingerTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView registerClass:[MoreSingerTableViewCell class] forCellReuseIdentifier:@"moreSinger"];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.backgroundView = kBlurImageView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 25;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *titleView = [[UIView alloc] init];
    titleView.backgroundColor = [UIColor clearColor];
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 15, 100, 15)];
    titleLabel.textColor = [UIColor cyanColor];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.font = [UIFont fontWithName:@"DBLCDTempBlack" size:13.0];
    [titleView addSubview:titleLabel];
    UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0, 20, kWidth - 30, 1)];
    line.backgroundColor = [UIColor whiteColor];
    [titleLabel addSubview:line];
    NSArray *titleArray = @[@"华语乐坛",@"欧美流行",@"韩语乐坛",@"日语乐坛",@"其他"];
    titleLabel.text = [titleArray objectAtIndex:section];
    return titleView;
}
#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 5;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete method implementation.
    // Return the number of rows in the section.
    if (section == 4) {
        return 1;
    }
    return 3;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 45;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSArray *titleArray = @[@[@"华语男歌手",@"华语女歌手",@"华语乐队组合"],@[@"欧美男歌手",@"欧美女歌手",@"欧美乐队组合"],@[@"韩国男歌手",@"韩国女歌手",@"韩国乐队组合"],@[@"日本男歌手",@"日本女歌手",@"日本乐队组合"],@[@"其他"]];
    MoreSingerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"moreSinger" forIndexPath:indexPath];
    cell.singerLabel.text = [[titleArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
    return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
